import 'package:flutter/material.dart';

class HomeNav extends StatelessWidget {
  const HomeNav({super.key});

  // 导航数据
  static List navList = [
    {'title': '我的房屋', 'icon': 'images/house_nav_icon@2x.png'},
    {'title': '我的报修', 'icon': 'images/repair_nav_icon@2x.png'},
    {'title': '访客登记', 'icon': 'images/visitor_nav_icon@2x.png'},
  ];

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(10),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(10),
        color: Colors.white,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children:
            navList.map((item) {
              return Column(
                children: [
                  //图标
                  Image.asset(item['icon'], height: 32, width: 32),
                  SizedBox(height: 5),
                  //标题
                  Text(
                    item['title'],
                    style: TextStyle(
                      fontSize: 14,
                      color: Color.fromARGB(255, 99, 144, 172),
                    ),
                  ),
                ],
              );
            }).toList(),
      ),
    );
  }
}
